import http from "@/utils/http";

export default {
    getlist: (): Promise<Vm.Address[]> => http<null, Vm.Address[]>({ url: 'address/list' }),
    add: (data: HttpPayload.AddressCRUD): Promise<number> => http<HttpPayload.AddressCRUD, number>({ url: 'address/add', method: 'post', data }),
    edit : (data:HttpPayload.AddressCRUD):Promise<null> => http<HttpPayload.AddressCRUD,null>({url:'address/update',method:'post',data}),
    getdefault: (): Promise<Vm.Address> => http<null, Vm.Address>({ url: 'address/get_default' }),
    setdefault: (id:number) => http<number,any>({ url: 'address/set_default/' + id }),
    remove:(id:number)=>http({url:'address/remove/'+id})
}